#include<bits/stdc++.h>
using namespace std;
int n , c[1010] = {0} , a[1010];
int main(){
	freopen("random.in" , "r" , stdin);
	freopen("random.out" , "w" , stdout);
	int count = 0;
	cin >> n;
	for(int i = 1 ; i <= n ; i++){
		int m;
		cin >> m;
		c[m]++;
		if(c[m] == 1){
			count++;
		}
	}
	cout << count << endl;
	for(int i = 1 ; i <= 1009 ; i++){
		if(c[i] != 0){
			cout << i << " ";
		}
	}
	cout << endl;
	return 0;
}